package com.woniuxy02;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-10-23 15:19
 */
public class Test10 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        //系统产生随机数
        int random = (int) (Math.random() * 100);
        System.out.println("random="+random);
        int num;
        do{
            System.out.println("输入你猜到的数字");
            num=scanner.nextInt();
            if(num>random){
                System.out.println("猜大了");
            }else if(num<random){
                System.out.println("猜小了");
            }else{
                System.out.println("猜对了");
            }
        }while (num!=random);

        System.out.println("游戏结束");

    }
}
